package com.bingo.mpa.util;

public class Tools
{
	/**
	 * sql关键字过滤条件，特殊字符处理
	 * @param str
	 * @return
	 */
	public static String replaceStr(String str)
    {
		if(str == null)
		{
			return str;
		}
        String replaceStr = str.replace("[", "[[]");// 此句一定要在最前面
        replaceStr = replaceStr.replace("_", "[_]");
        replaceStr = replaceStr.replace("%", "[%]");
        replaceStr = replaceStr.replace("'", "\'");
        replaceStr = replaceStr.replace("‘", "\\‘");
        replaceStr = replaceStr.replace("’", "\\’");
        replaceStr = replaceStr.replace("{", "[{]");
        return replaceStr;
    }
}
